
<!-- saved from url=(0026)http://localhost/test.html -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>骡窝窝问答</title>
    <meta name="viewport"
          content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui,viewport-fit=cover">
    <meta name="copyright" content="Copyright (c) 2006-2018 Mafengwo.">
    <meta name="format-detection" content="telephone=no,address=no">
    <meta name="referrer" content="always">
    <meta name="apple-mobile-web-app-capable" content="no">
    <meta name="apple-mobile-web-app-status-bar-style" content="no">

    <link href="/css/mobile+css+head_mobile+css+ui^YVw^1526627473.css" rel="stylesheet" type="text/css">


    <link href="/css/ask.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="/css/myStrategyComment.css"/>


    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/plugins/form/jquery.form.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>

    <script>
        $(function () {
            $(".askBtn").click(function () {
                if ($('.title').val() == null || "" == $('.title').val()) {
                    $(document).dialog({
                        type: 'notice',
                        infoText: '问题不能为空!',
                        autoClose: 1000,
                        position: 'center'  // center: 居中; bottom: 底部
                    });
                } else if ($('.content').val() == null || "" == $('.content').val()) {
                    $(document).dialog({
                        type: 'notice',
                        infoText: '问题的详情不能为空!',
                        autoClose: 1000,
                        position: 'center'  // center: 居中; bottom: 底部
                    });

                }else if ($('.region').val() == null || "" == $('.region').val()) {
                    $(document).dialog({
                        type: 'notice',
                        infoText: '地区不能为空!',
                        autoClose: 1000,
                        position: 'center'  // center: 居中; bottom: 底部
                    });

                } else {
                    $("#askForm").ajaxSubmit(function (data) {
                        if (data.succeed) {
                            location.href = '/question.html';
                        }
                    });

                }
            });

            $(".rect").click(function () {
                $("#file").click();
            });

            $("#file").change(function () {
                if ($(this).val()) {
                    $("#imgForm").ajaxSubmit(function (data) {
                        $(".rect").html("<img src='" + data.url + "'></img>");
                        $("#imgUrl").val(data.url);
                    });
                }
            });


        });
    </script>

</head>
<body>
<div id="pos38"></div>
<header class="MfwHead">
    <div class="LBtn">
        <a class="btn back"
           href="javascript:void(window.history.length > 1 ? window.history.back() : document.location.href='index.html')"
           id="_j_top_history_back"><img src="/img/back.jpg" height="45px" width="45px"></a>
    </div>
    <div class="CBtn"><h1>提问题</h1></div>
    <div class="RBtn">
    </div>
</header>


<section class="Addnew">
    <form action="/questions/ask" method="post" id="askForm">
        <div id="_j_publish_box" class="ask_tan_con">
            <dl>
                <dd class="_j_word">
                    <input class="_j_q_title _j_word_check title" placeholder="请输入你的问题，不少于10个字哦" name="title">
                    <input value="0" type="hidden" class="_j_q_qid">

                    <div class="wordsnum">
                        <span class="_j_word_num">0</span>/<span class="_j_max_num">80</span>
                        <span class="_j_min_num" style="display:none;">10</span>
                    </div>
                    <div class="err-tips" style="display: none;"></div>
                </dd>
            </dl>
            <dl>
                <dt>问题说明</dt>
                <dd class="con_textarea _j_word" id="con_textarea">
                    <textarea rows="1" id="pnl_textarea" class="_j_q_content _j_word_check content"
                              name="content"></textarea>
                    <div class="wordsnum"><span class="_j_word_num">0</span>/<span class="_j_max_num">1000</span></div>
                    <div class="err-tips" style="display: none;"></div>
                </dd>
            </dl>
            <dl>
                <dt>提问地区</dt>
                <dd class="_j_word">
                    <input class="_j_q_title _j_word_check region" placeholder="请说出你要提问的地区" name="region">
                </dd>
            </dl>
            <dl>
                <div class="container imgs">
                    <p>上传图片</p>
                    <div class="row">
                        <div class="col-2 rect" style="width: 37%;height: 10%;text-align: center">
                            <span>上传</span>
                        </div>
                    </div>
                </div>
            </dl>

            <dl>
                <dd>
                    <a class="_j_publish_question askBtn">发布问题</a>
                </dd>
            </dl>
        </div>
        <input type="hidden" id="imgUrl" name="imgUrl"/>
    </form>
    <form id="imgForm" method="post" enctype="multipart/form-data" action="/images">
        <input type="file" id="file" style="display: none" name="file"/>
    </form>
</section>


</body>
</html>